import request from "@/utils/request";

// 查询资产记录列表
export function listRecord(query) {
  return request({
    url: "/cld/record/list",
    method: "get",
    params: query,
  });
}

// 投放记录查询
export function deliveryList(query) {
  return request({
    url: "/cld/record/deliveryList",
    method: "get",
    params: query,
  });
}

// 资产维修记录查询
export function getRepairList(query) {
  return request({
    url: "/cld/assetsRepair/getRepairList",
    method: "get",
    params: query,
  });
}

// 资产维修记录查询
export function getRepairGroupProjectList(query) {
  return request({
    url: "/cld/assetsRepair/getRepairGroupProjectList",
    method: "get",
    params: query,
  });
}

// 资产维修明细记录查询
export function getRepairDetailsList(query) {
  return request({
    url: "/cld/assetsRepair/getRepairDetailsList",
    method: "get",
    params: query,
  });
}

// 根据资产记录id查询资产维修
export function getRepairDetails(assetsRecordId) {
  return request({
    url: "/cld/assetsRepair/getRepairDetails/" + assetsRecordId,
    method: "get",
  });
}

// 根据资产记录id查询资产维修
export function addRepairDetails(data) {
  return request({
    url: "/cld/assetsRepair",
    method: "post",
    data: data,
  });
}

// 查询资产记录详细
export function getRecord(assetsRecordId) {
  return request({
    url: "/cld/record/" + assetsRecordId,
    method: "get",
  });
}

// 新增资产记录
export function addPlacementRecord(data) {
  return request({
    url: "/cld/record",
    method: "post",
    data: data,
  });
}

// 新增资产记录
export function batchAddPlacementRecord(data) {
  return request({
    url: "/cld/record/batchAdd",
    method: "post",
    data: data,
  });
}

// 新增闲置记录
export function addLedeRecord(data) {
  return request({
    url: "/cld/record/lede",
    method: "post",
    data: data,
  });
}

// 新增报废记录
export function addScrapRecord(data) {
  return request({
    url: "/cld/record/scrap",
    method: "post",
    data: data,
  });
}

// 修改资产记录
export function updateRecord(data) {
  return request({
    url: "/cld/record",
    method: "put",
    data: data,
  });
}

// 删除资产记录
export function delRecord(assetsRecordId) {
  return request({
    url: "/cld/record/" + assetsRecordId,
    method: "delete",
  });
}

// 资产报废审核
export function updateRecordScrap(data) {
  return request({
    url: "/cld/record/audit",
    method: "put",
    data: data,
  });
}
